<?php
include_once('connexpdo.php');
include_once ('fonctions.php');?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- PAGE TITLE -->
<title>ASPC Badminton</title>
<!-- MAKE IT RESPONSIVE -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- BOOTSTRAP -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <!-- MAIN STYLE -->
    <link href="css/customize.css" rel="stylesheet" media="screen">
    <link href="css/style.css" rel="stylesheet" media="screen">
   <!--           <link rel="stylesheet" type="text/css" href="css/demo.css" />
		<link rel="stylesheet" type="text/css" href="css/styles.css" />
		<link rel="stylesheet" type="text/css" href="css/elastislide.css" />
				-->
				<link rel="stylesheet" type="text/css" href="css/elastislide.css" />
						<link rel="stylesheet" type="text/css" href="css/styles.css" />
								<link rel="stylesheet" type="text/css" href="css/demo.css" />
    <!-- FONTS -->
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    		<![endif]-->
    		</head>
    		<!-- START BODY -->
    		<body>
<?php 
function affiche_les_albumstest(){
$resultat =0;
$nbresultat= 0;
$connexion = connexpdo();
$requete = ('SELECT ALB_ID FROM album WHERE ALB_ID >9 ORDER BY ALB_ID DESC');
$resultat = $connexion->query($requete);
while ($donnees = $resultat->fetch(PDO::FETCH_ASSOC)){
	$id =$donnees['ALB_ID'];
	affiche_1albumtest($id);
}
print_r($resultat);
$nbresult = $resultat->rowcount();
print_r($nbresult);
}


function affiche_1albumtest($id){
$resultat =0;
$connexion = connexpdo();
$requete = ('SELECT * FROM album a INNER JOIN image i ON a.ALB_ID = i.IM_ID_APPARTENIR 
WHERE IM_ID_APPARTENIR ='.$id);
$resultat = $connexion->query($requete);
$donnees = $resultat->fetch(PDO::FETCH_ASSOC);
?>
<div id="rg-gallery" class="rg-gallery">
<div class="rg-thumbs">
<!-- Elastislide Carousel Thumbnail Viewer -->
<div class="es-carousel-wrapper">
		<div class="es-nav">
		<span class="es-nav-prev">Previous</span>
		<span class="es-nav-next">Next</span>
				</div>
				<span style="color: white; font-size: 2em;"><?php echo $donnees['ALB_TITRE'];?></span>
				<div class="es-carousel">
				<ul>
				<?php while ($donnees = $resultat->fetch(PDO::FETCH_ASSOC)){ ?>
					<li style="width: 65px; height: 65px;"><a href="#">
					<img style="height: 100%; width: 100%;" src="images/Albums/<?php echo $donnees['ALB_URL'].'/'. $donnees['IM_FICHIER']?> "
					data-large="images/Albums/<?php echo $donnees['ALB_URL'].'/'. $donnees['IM_FICHIER']?>" 
					alt="<?php echo $donnees['IM_TITRE'];?>" data-description="<?php echo $donnees['IM_DESCRIPTION'];?>" /></a></li>
					<?php
 					}?>
				</ul>
								</div>
								</div>
								<!-- End Elastislide Carousel Thumbnail Viewer -->
								</div><!-- rg-thumbs -->
								</div><!-- rg-gallery -->
								<?php
								print_r($resultat);
								$nbresult = $resultat->rowcount();
								print_r($nbresult);
								$resultat->closeCursor();
}
affiche_1album();
//$id = 10;
//affiche_1albumtest($id);
//$id2 = 11;
//affiche_1albumtest($id2);
//affiche_1albumtest($nb);
//affiche_les_albumstest();
 affiche_scripts();?>
</body><?php 
?>